var elementCode="";//全局变量，用于查询详细元素的报警信息
//系统加完运行
$(function () {
    tick();
    setInterval("tick();", 1000);
    roadChart();
    visibilityChart();
    weatherChart();
    equipmentStatus();
    setInterval("roadChart();", 300000);
    setInterval("weatherChart();", 300000);
    setInterval("visibilityChart();", 300000);
    setInterval("equipmentStatus();", 300000);
    getUser();
    showAlertByUser();
});
var user={};
//系统时间
function tick() {
    var years,
        months,
        days,
        hours,
        minutes,
        seconds;
    var intYears,
        intMonths,
        intDays,
        intHours,
        intMinutes,
        intSeconds;
    var today;
    today = new Date(); //系统当前时间
    intYears = today.getFullYear(); //得到年份,getFullYear()比getYear()更普适
    intMonths = today.getMonth() + 1; //得到月份，要加1
    intDays = today.getDate(); //得到日期
    intHours = today.getHours(); //得到小时
    intMinutes = today.getMinutes(); //得到分钟
    intSeconds = today.getSeconds(); //得到秒钟
    years = intYears + "-";
    if (intMonths < 10) {
        months = "0" + intMonths + "-";
    } else {
        months = intMonths + "-";
    }
    if (intDays < 10) {
        days = "0" + intDays + " ";
    } else {
        days = intDays + " ";
    }
    if (intHours == 0) {
        hours = "00:";
    } else if (intHours < 10) {
        hours = "0" + intHours + ":";
    } else {
        hours = intHours + ":";
    }
    if (intMinutes < 10) {
        minutes = "0" + intMinutes + ":";
    } else {
        minutes = intMinutes + ":";
    }
    if (intSeconds < 10) {
        seconds = "0" + intSeconds + " ";
    } else {
        seconds = intSeconds + " ";
    }
    timeString = years + months + days + hours + minutes + seconds;
    $("#showTimeDiv").html(timeString);
}
//显示用户名
function getUser() {
    $.getJSON("sys/user/info?_"+$.now(), function(r){
        $("#loginName").html("用户名： " + r.user.username);
        user=r.user;
    });
}

//湿滑程度极值
function sendFriction(result) {
    if (result.minFriction.friction == null) {
        $("#shcdSpan").html("-");
    } else {
        var a = result.minFriction.friction;
        var b = "";
        if (a <= 0.30) {
            b = "极差";
            //$("#shcdSpan").css("color","red");
            //$("#shcdSpan1").css("color","red");
        } else if (a <= 0.40) {
            b = "很差";
            //$("#shcdSpan").css("color","#orange");
            //$("#shcdSpan1").css("color","#orange");
        } else if (a <= 0.50) {
            b = "较差";
            //$("#shcdSpan").css("color","#yellow");
            //$("#shcdSpan1").css("color","#yellow");
        } else if (a <= 0.55) {
            b = "稍差";
            //$("#shcdSpan").css("color","#00aeff");
            //$("#shcdSpan1").css("color","#00aeff");
        } else if (a <= 0.64) {
            b = "正常";
            //$("#shcdSpan").css("color","#19bb9a");
            //$("#shcdSpan1").css("color","#19bb9a");
        } else {
            b = "良好";
            //$("#shcdSpan").css("color","#19bb9a");
            //$("#shcdSpan1").css("color","#19bb9a");
        }
        $("#shcdSpan").html(a+"("+b+")");
        $("#xy2").val(result.minFriction.pointId);
    }
}
//路面温度极值
function sendRoadTemp(result) {
    if (result.minTemp.roadSurfaceTemp == null) {
        $("#lmwdSpan").html("-");
    } else {
        $("#lmwdSpan").html(result.minTemp.roadSurfaceTemp+"℃");
        var a = result.minTemp.roadSurfaceTemp;
        $("#xy1").val(result.minTemp.pointId);
    }
}
//相对湿度极值
function sendRelativeHumidity(result){
    if (result.maxRelativeHumidity.relativeHumidity == null) {
        $("#xdsdSpan").html("-");
    } else {
        $("#xdsdSpan").html(result.maxRelativeHumidity.relativeHumidity+"%");
        $("#xy6").val(result.maxRelativeHumidity.pointId);
    }
}
//空气温度极值
function sendWeatherTemp(result){
    if (result.minWeatherTemp.airTemp == null) {
        $("#kqwdSpan").html("-");
    } else {
        $("#kqwdSpan").html(result.minWeatherTemp.airTemp+"℃");
        $("#xy5").val(result.minWeatherTemp.pointId);
    }
}
//风速极值
function sendWendSpeed(result){
    if (result.maxWindSpeed.windSpeed == null) {
        $("#fsSpan").html("-");
    } else {
        $("#fsSpan").html(result.maxWindSpeed.windSpeed+"m/s");
        $("#xy7").val(result.maxWindSpeed.pointId);
    }
}
//降水量极值
function sendPrecipitation(result){
    if (result.maxPrecipitation.precipitation == null) {
        $("#jslSpan").html("-");
    } else {
        $("#jslSpan").html(result.maxPrecipitation.precipitation+"mm");
        $("#xy8").val(result.maxPrecipitation.pointId);
    }
}
//水膜高度
function sendWaterFilmHeight(result) {
    if (result.minWaterFilmHeight.waterFilmHeight == null) {
        $("#smhdSpan").html("-");
    } else {
        if(result.minWaterFilmHeight.waterFilmHeight<100){
            $("#smhdSpan").html(result.minWaterFilmHeight.waterFilmHeight+"μm");
        }else{
            $("#smhdSpan").html(Math.round(result.minWaterFilmHeight.waterFilmHeight)+"μm");
        }
        $("#xy4").val(result.minWaterFilmHeight.pointId);
    }
}
//能见度极值
function sendVisibility(result) {
    if (result.minVisi.visibility == null) {
        $("#njdSpan").html("-");
    } else {
        var a = result.minVisi.visibility;
        var b = "";
        if (a <= 50) {
            b = "大雾";
            //$("#njdSpan").css("color","red");
        } else if (a <= 200) {
            b = "浓雾";
            //$("#njdSpan").css("color","red");
        } else if (a <= 500) {
            b = "雾";
            //$("#njdSpan").css("color","orange");
        } else if (a <= 1000) {
            b = "中雾";
            //$("#njdSpan").css("color","yellow");
        } else if (a < 2000) {
            b = "轻雾";
            //$("#njdSpan").css("color","#00aeff");
        } else {
            b = "良好";
            //$("#njdSpan").css("color","#19bb9a");
        }
        $("#njdSpan").html(result.minVisi.visibility.split(".")[0]+"("+b+")");
        $("#xy3").val(result.minVisi.pointId);
    }

}
//路面数据统计
function roadChart(){
    $.getJSON("baseinfo/lhpdataroaddetector/roadChart?_"+$.now(), function(r){
        var data=r.data;
        sendFriction(data);
        sendRoadTemp(data);
        sendWaterFilmHeight(data);
        var pNameList = data.pNameList;
        var tempList = data.tempList;
        var fricationList = data.fricationList;
        var waterFilmHeightList = data.waterFilmHeightList;
        var myChart1 = echarts.init(document.getElementById('roadChart'));
        var colors = ['#5793f3', '#d14a61', '#675bba'];
        option1 = {
            color: colors,
            tooltip: {
                trigger: 'axis',
            },
            grid: {
                left:30,
                right:90,
                top:45,
                bottom:50
            },

            legend: {
                data:[{
                    name :'路面温度',
                    textStyle : {
                        color : "#ffffff"
                    }
                },
                    {
                        name :'湿滑程度',
                        textStyle : {
                            color : "#ffffff"
                        }
                    },
                    {
                        name :'水膜厚度',
                        textStyle : {
                            color : "#ffffff"
                        }
                    }
                ]
            },
            xAxis: [
                {
                    splitLine:{show: false},
                    splitArea : {show : false},
                    type: 'category',
                    axisLine:{
                        lineStyle:{
                            color:'white',
                            width:1
                        }
                    },
                    axisLabel: {
                        interval:0,
                        rotate:40
                    },
                    axisTick: {
                        alignWithLabel: true
                    },
                    data: pNameList
                }
            ],
            yAxis: [

                {	splitLine:{show: false},
                    splitArea : {show : false},
                    type: 'value',
                    name: '路面温度',
                    // min: 0,
                    //max: 60,
                    position: 'left',
                    axisLine: {
                        lineStyle: {
                            color: colors[0]
                        }
                    },
                    axisLabel: {
                        formatter: '{value}'
                    }
                },
                {splitLine:{show: false},
                    splitArea : {show : false},
                    type: 'value',
                    name: '湿滑程度',
                    min: 0,
                    max: 1,
                    position: 'right',
                    axisLine: {
                        lineStyle: {
                            color: colors[1]
                        }
                    },
                    axisLabel: {
                        formatter: '{value}'
                    }
                },
                {splitLine:{show: false},
                    splitArea : {show : false},
                    type: 'value',
                    name: '水膜厚度',
                    position: 'right',
                    offset: 50,
                    axisLine: {
                        lineStyle: {
                            color: colors[2]
                        }
                    },
                    axisLabel: {
                        formatter: '{value}'
                    }
                }
            ],
            series: [
                {
                    name:'路面温度',
                    type:'line',
                    yAxisIndex: 0,
                    data: tempList
                },
                {
                    name:'湿滑程度',
                    type:'line',
                    yAxisIndex: 1,
                    data: fricationList
                },
                {
                    name:'水膜厚度',
                    type:'line',
                    yAxisIndex: 2,
                    data: waterFilmHeightList
                }
            ]
        };
        myChart1.setOption(option1);

        $(window).on('resize',
            function() {
                myChart1.resize();
            });
    });
}

//气象数据统计
function weatherChart(){
    $.getJSON("baseinfo/lhpdataweatherstation/weatherChart?_"+$.now(), function(r){
        var data=r.data;
        sendWeatherTemp(data);
        sendRelativeHumidity(data);
        sendWendSpeed(data);
        sendPrecipitation(data);
        var pNameList = data.pNameList;
        var weatherTempList = data.weatherTempList;
        var windSpeedList = data.windSpeedList;
        var precipitationList = data.precipitationList;
        var myChart3 = echarts.init(document.getElementById('weatherChart'));
        var colors = ['#5793f3', '#d14a61', '#675bba'];
        option2 = {
            color: colors,
            tooltip: {
                trigger: 'axis',
            },
            grid: {
                left:30,
                right:90,
                top:45,
                bottom:50
            },

            legend: {
                data:[{
                    name :'空气温度',
                    textStyle : {
                        color : "#ffffff"
                    }
                },
                    {
                        name :'风速',
                        textStyle : {
                            color : "#ffffff"
                        }
                    },
                    {
                        name :'降水量',
                        textStyle : {
                            color : "#ffffff"
                        }
                    }
                ]
            },
            xAxis: [
                {
                    splitLine:{show: false},
                    splitArea : {show : false},
                    type: 'category',
                    axisLine:{
                        lineStyle:{
                            color:'white',
                            width:1
                        }
                    },
                    axisLabel: {
                        interval:0,
                        rotate:40
                    },
                    axisTick: {
                        alignWithLabel: true
                    },
                    data: pNameList
                }
            ],
            yAxis: [

                {	splitLine:{show: false},
                    splitArea : {show : false},
                    type: 'value',
                    name: '空气温度',
                    // min: 0,
                    //max: 60,
                    position: 'left',
                    axisLine: {
                        lineStyle: {
                            color: colors[0]
                        }
                    },
                    axisLabel: {
                        formatter: '{value}'
                    }
                },
                {splitLine:{show: false},
                    splitArea : {show : false},
                    type: 'value',
                    name: '风速',
                    min: 0,
                    max: 1,
                    position: 'right',
                    axisLine: {
                        lineStyle: {
                            color: colors[1]
                        }
                    },
                    axisLabel: {
                        formatter: '{value}'
                    }
                },
                {splitLine:{show: false},
                    splitArea : {show : false},
                    type: 'value',
                    name: '降水量',
                    position: 'right',
                    offset: 50,
                    axisLine: {
                        lineStyle: {
                            color: colors[2]
                        }
                    },
                    axisLabel: {
                        formatter: '{value}'
                    }
                }
            ],
            series: [
                {
                    name:'空气温度',
                    type:'line',
                    yAxisIndex: 0,
                    data: weatherTempList
                },
                {
                    name:'风速',
                    type:'line',
                    yAxisIndex: 1,
                    data: windSpeedList
                },
                {
                    name:'降水量',
                    type:'line',
                    yAxisIndex: 2,
                    data: precipitationList
                }
            ]
        };
        myChart3.setOption(option2);

        $(window).on('resize',
            function() {
                myChart3.resize();
            });
    });

}
//能见度数据统计
function visibilityChart(){
    $.getJSON("baseinfo/lhpdatavisibility/visibilityChart?_"+$.now(), function(r){
        var data=r.data;
        sendVisibility(data);
        var pNameList = data.pNameList;
        var visiList = data.visiList;
        var myChart2 = echarts.init(document.getElementById('visibilityChart'));

        option2 = {
            tooltip: {
                trigger: 'axis'
            },
            xAxis: {
                type: 'category',
                data: pNameList,
                axisLine:{
                    lineStyle:{
                        color:'white',
                        width:1
                    }
                },
                axisLabel: {
                    interval:0,
                    rotate:40
                },
                axisTick: {
                    alignWithLabel: true
                }
            },
            yAxis: {
                name:'单位：m',
                type: 'value',
                axisLine:{
                    lineStyle:{
                        color:'white',
                        width:1
                    }
                }
            },
            legend: {
                data : [ {
                    name :'能见度',
                    textStyle : {
                        color : "#ffffff"
                    }
                }
                ]
            },


            grid:{
                left:40,
                right:20,
                top:40,
                bottom:50
            },
            series:[{
                name:'能见度',
                data:visiList,
                type:'line'
            }

            ]
        };
        myChart2.setOption(option2);
        $(window).on('resize',
            function() {
                myChart2.resize();
            });
    });
}




function initAMap() {
    amap = new AMap.Map('ditu', {
        resizeEnable : true,
        center : [ lng, lat ],
        zoom : zoomLevel,
        zooms : [ 5, 18 ]
    });
    //地图加载完成后运行的方法
    amap.on('complete', function() {

        initAMapPoint();

       jiaotong();
       //gaodeMap();





    });
}


//显示安装点，并配置安装点点击事件
var aPointCluster;
var pointMarkerMap = new Map();
var pointMap=new Map()
function initAMapPoint() {
    if (aPointCluster) {
        aPointCluster.setMap(null);
    }
    var pointMarkers = [];

    $.ajax({
        type : "post",
        url : "baseinfo/lhpinstallationpoint/getPointByUserId",
        data : {},
        dataType : "json",
        async : false,
        success : function(r) {
            var data=r.list;
            for (var i = 0; i < data.length; i++) {
                var pointId = data[i].id;
                var pCode = data[i].pointCode;
                var x = data[i].xgaode;
                var y = data[i].ygaode;
                var pointName = data[i].pointName;
                pointMap.set(pointId, [x,y]);
                if (pointName.indexOf("凝冰") < 0) {
                    var pointEquipStatus = data[i].pointEquipStatus;
                    var imgUrl = "../statics/image/bluePoint.png";
                    var marker = new AMap.Marker({
                        title : pointName,
                        position : [x, y],
                        icon : new AMap.Icon({
                            size : new AMap.Size(29, 29), //图标大小
                            image : imgUrl
                        })
                    });
                    marker.setMap(amap);
                    pointMarkerMap.set(pointId, marker);
                    pointMarkers.push(marker);
                    var hasNingbing = data[i].hasNingbing;

                    markerClick(pointId, hasNingbing, marker, pointName, x, y, pCode);

                }
                if (i == (data.length - 1)) { //点聚合
                    aPointCluster = new AMap.MarkerClusterer(amap, pointMarkers); //gridSize 范围设定
                }
            }
        }
    });
}
//点击安装点，弹框事件
function markerClick(pId, hasNingbing, marker, pointName, xGaode, yGaode, pCode) {
    marker.on('click', function(e) {
        var width = "0px";
        var height = "0px";
        var scStatus = true;
        if (hasNingbing == "0") { //弹到含有凝冰和 气象点信息框
            width = "1200px";
            height = "805px";
            scStatus = false;
            dialogOpen({
                title : '设备参数',
                url : '../../modules/baseinfo/ningBingControllPage.html?pointId='+pId,
                width : width,
                height : height,
                scroll : scStatus,
                btn : '关闭',
                yes : function() {
                    layer.closeAll();
                }
            });
        } else { //弹到气象点信息框
            width = "1300px";
            height = "600px";
            scStatus = false;
            dialogOpen({
                title : '设备参数',
                url : '../../modules/baseinfo/showEquipmentParams.html?pointId='+pId,
                width : width,
                height : height,
                scroll : scStatus,
                btn : '关闭',
                yes : function() {
                    layer.closeAll();
                }
            });
        }

    });
}
//点击最恶劣情况跳点
function showInsPoint(index) {
    var xy;
    if (index == 1) {
        var  pointId=$("#xy1").val();
        xy=pointMap.get(pointId);
    }
    if (index == 2) {
        var  pointId=$("#xy2").val();
        xy=pointMap.get(pointId);
    }
    if (index == 3) {
        var  pointId=$("#xy3").val();
        xy=pointMap.get(pointId);
    }
    if (index == 4) {
        var  pointId=$("#xy4").val();
        xy=pointMap.get(pointId);
    }
    if (index == 5) {
        var  pointId=$("#xy5").val();
        xy=pointMap.get(pointId);
    }
    if (index == 6) {
        var  pointId=$("#xy6").val();
        xy=pointMap.get(pointId);
    }
    if (index == 7) {
        var  pointId=$("#xy7").val();
        xy=pointMap.get(pointId);
    }
    if (index == 8) {
        var  pointId=$("#xy8").val();
        xy=pointMap.get(pointId);
    }
    amap.setZoomAndCenter(12, xy);
}
//显示元素报警信息
function showElementAlarmInfo(obj,index){
    elementCode = index;
    $("#elementAlertInfoParent").css("display","none");
    if($(obj).html() != 0){
        showElementAlert(index);
    }
}


//自动滚动
function autoScroll(obj) {
    var n = $(obj).find("li").height();
    $(obj).find("ul").animate({
        marginTop : -5
    }, 500, function() {
        $(this).css({
            marginTop : "0px"
        }).find("li:first").appendTo(this);
    })
}

var t1 = setInterval('autoScroll("#alertInfoParent")', 1500);
var t2 = setInterval('autoScroll("#elementAlertInfoParent")', 1500);
setInterval("showAlertByUser();", 300000);
$(document).ready(function() {
    $("#alertInfo").hover(
        function() {
            clearInterval(t1);
        },
        function() {
            clearInterval(t2);
            t1 = setInterval('autoScroll("#alertInfoParent")', 1500);
            t2 = setInterval('autoScroll("#elementAlertInfoParent")', 1500);
        }
    );
    $("#elementAlertInfo").hover(
        function() {
            clearInterval(t2);
        },
        function() {
            clearInterval(t1);
            t1 = setInterval('autoScroll("#alertInfoParent")', 1500);
            t2 = setInterval('autoScroll("#elementAlertInfoParent")', 1500);
        }
    );

});

//报警定位安装点
function showPoint1(ele) {
    var pointId = ($(ele).attr("class"));
    var xy=pointMap.get(pointId);
    amap.setZoomAndCenter(12, xy);
}

//右侧报警信息显示
function showAlertByUser() {
    $.ajax({
        type : "post",
        url : "homepage/showAlertByUser",
        data : {},
        dataType : "json",
        success : function(r) {
            var data=r.infoMap.fanhui;
            var alert1 = "";
            if(data.length>0){
                $("#alertInfoParent").css("display","block");
                for (var i = 0; i < data.length; i++) {
                    alert1 += "<li class=\"" + data[i].pointId + "\" style=\"color:red;font-size: 16px;width:99%;font-weight: 600;margin: 6px 0\" onclick=\"showPoint1(this);\">" + data[i].alertTime + "&nbsp;&nbsp;" + data[i].pointName + "&nbsp;&nbsp;" + data[i].alertInfo + "</li>";
                    //根据安装点id找到安装点,并根据预警类型更换图片
                    var mar = pointMarkerMap.get(data[i].pointId);
                    //根据预警类型找到图片
                    var imgurl = "";
                    if (data[i].alertLevel == "1" || data[i].alertLevel == "2") {
                        imgurl = "../statics/image/seriousPoint.gif"
                    } else {
                        imgurl = "../statics/image/yellowPoint.gif"
                    }
                    //改变安装点图片
                    mar.setIcon(imgurl);
                }
            }else{
                $("#alertInfoParent").css("display","none");
                alert1 += "<li style=\"color:white;font-size: 16px;width:99%;font-weight: 600;margin: 6px 0\"> 无预警信息</li>";
            }
            $("#alertInfo").html(alert1);
            //设置报警数量
            if(r.infoMap.roadSurfaceTemp == 0){
                $("#roadSurfaceTempCount").html(0)
            }else{
                $("#roadSurfaceTempCount").html(r.infoMap.roadSurfaceTemp);
            }
            if(r.infoMap.friction == 0){
                $("#frictionCount").html(0)
            }else{
                $("#frictionCount").html(r.infoMap.friction);
            }
            if(r.infoMap.waterFilmHeight == 0){
                $("#waterFilmHeightCount").html(0)
            }else{
                $("#waterFilmHeightCount").html(r.infoMap.waterFilmHeight);
            }
            if(r.infoMap.visibility == 0){
                $("#visibilityCount").html(0)
            }else{
                $("#visibilityCount").html(r.infoMap.visibility);
            }
            if(r.infoMap.airTemp == 0){
                $("#airTempCount").html(0)
            }else{
                $("#airTempCount").html(r.infoMap.airTemp);
            }
            if(r.infoMap.relativeHumidity == 0){
                $("#relativeHumidityCount").html(0)
            }else{
                $("#relativeHumidityCount").html(r.infoMap.relativeHumidity);
            }
            if(r.infoMap.windSpeed == 0){
                $("#windSpeedCount").html(0)
            }else{
                $("#windSpeedCount").html(r.infoMap.windSpeed);
            }
            if(r.infoMap.precipitation == 0){
                $("#precipitationCount").html(0)
            }else{
                $("#precipitationCount").html(r.infoMap.precipitation);
            }

            //播放警报
           /* if ((njd.length != 0 && flag1 == 0) || (lmwd.length != 0 && flag2 == 0) || (shcd.length != 0 && flag3 == 0)) {
                alertSound();
            }*/
        }
    });
}

//查看更多报警信息
function findMore() {
    $("#alertInfoParent").css("display","none");
    $("#elementAlertInfoParent").css("display","none");
    dialogOpen({
        title : '报警信息详情',
        url : '../../modules/baseinfo/lhpalert.html?alertType=' + elementCode,
        width : '1630px',
        height : '750px',
        scroll : "yes",
        //btn:'关闭',
        yes : function() {
            layer.closeAll();
            //layer.close(index);
        }
    });
}
function findMore1() {
    $("#alertInfoParent").css("display","none");
    $("#elementAlertInfoParent").css("display","none");
    dialogOpen({
        title : '报警信息详情',
        url : '../../modules/baseinfo/lhpalert.html?alertType=',
        width : '1630px',
        height : '750px',
        scroll : "yes",
        //btn:'关闭',
        yes : function() {
            layer.closeAll();
            //layer.close(index);
        }
    });
}


//图例开关
function showTuli() {
    var value = document.getElementById("tuli").style.display;
    if (value == 'none') {
        document.getElementById("tuli").style.display = "block";
        document.getElementById("qiehuanditu").style.display = "none";
    } else {
        document.getElementById("tuli").style.display = "none";
    }
}



//自建站信息
function equipmentInfo() {
    /*document.getElementById("qiehuanditu").style.display = "none";
    document.getElementById("tuli").style.display = "none";*/
    dialogOpen({
        title : '自建站参数列表',
        url : '../../modules/baseinfo/lhpDataEquipmentinfo.html',
        width : '1630px',
        height : '750px',
        scroll : "yes",
        //btn:'关闭',
        yes : function() {
            layer.closeAll();
            //layer.close(index);
        }
    });
}



function closeAlarm() {
    $("#alertInfoParent").css("display","none");
}
function closeElementAlarm() {
    $("#elementAlertInfoParent").css("display","none");
}
function showAlarmDiv(){
    if($("#alertInfoParent").css("display") == "none"){
        $("#alertInfoParent").css("display","block");
    }else{
        $("#alertInfoParent").css("display","none");
    }
}
function showElementAlert(index){
    $.ajax({
        type : "post",
        url : "homepage/showAlertByUserAndElement",
        data : {type:index},
        dataType : "json",
        success : function(r) {
            var data=r.list;
            var alert1 = "";
            if(data.length>0){
                $("#elementAlertInfoParent").css("display","block");
                for (var i = 0; i < data.length; i++) {
                    alert1 += "<li class=\"" + data[i].pointId + "\" style=\"color:red;font-size: 16px;width:99%;font-weight: 600;margin: 6px 0\" onclick=\"showPoint1(this);\">" + data[i].alertTime + "&nbsp;&nbsp;" + data[i].pointName + "&nbsp;&nbsp;" + data[i].alertInfo + "</li>";
                }
            }
            $("#elementAlertInfo").html(alert1);
        }
    });
}
function equipmentStatus(){
    $.ajax({
        type : "post",
        url : "homepage/checkEquipmengStatus",
        data : {},
        dataType : "json",
        success : function(r) {
            var data=r.infoMap;
            $("#qxzOnline").html(data.qxzOnline);
            $("#qxzOffline").html(data.qxzOffline);
            $("#njdOnline").html(data.njdOnline);
            $("#njdOffline").html(data.njdOffline);
            $("#dmtcqOnline").html(data.dmtcqOnline);
            $("#dmtcqOffline").html(data.dmtcqOffline);
        }
    });
}
function findMoreVisibility(){
    dialogOpen({
        title : '能见度信息详情',
        url : '../../modules/baseinfo/lhpdatavisibility.html',
        width : '1630px',
        height : '750px',
        scroll : "yes",
        //btn:'关闭',
        yes : function() {
            layer.closeAll();
            //layer.close(index);
        }
    });
}
function findMoreRoadDetector(){
    dialogOpen({
        title : '地面探测器信息详情',
        url : '../../modules/baseinfo/lhpdataroaddetector.html',
        width : '1630px',
        height : '750px',
        scroll : "yes",
        //btn:'关闭',
        yes : function() {
            layer.closeAll();
            //layer.close(index);
        }
    });
}
function findMoreWeatherStation(){
    dialogOpen({
        title : '气象站信息详情',
        url : '../../modules/baseinfo/lhpdataweatherstation.html',
        width : '1630px',
        height : '750px',
        scroll : "yes",
        //btn:'关闭',
        yes : function() {
            layer.closeAll();
            //layer.close(index);
        }
    });
}
